{% for code,item in block.meta.items|default(null) %}
  {% if item.type != 'poster' %}
    <section id="js-affix-{{ code }}">
      <div class="item-title">
        <strong>{{ item.title }}</strong>
        <p class="text-muted">{{ item.desc }}</p>
      </div>

      <div class="panel-group sortable-list" id="js-accordion-{{ code }}"  data-code="{{ code }}" data-prefix="data[{{ code }}]" data-count="{{ item.count }}" data-role="collapse" role="tablist" aria-multiselectable="true">
        {% for dataId,data in  block.data[code]|default(null)  %}
          <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="{{code}}-heading-{{ dataId }}" data-toggle="collapse" data-parent="#js-accordion-{{ code }}" href="#{{code}}-collapse-{{ loop.index }}-{{ dataId }}" aria-expanded="false" aria-controls="{{code}}-collapse-{{ loop.index }}-{{ dataId }}">
              <h4 class="panel-title clearfix">
                <i class="js-move-seq glyphicon glyphicon-move pull-left mrs"></i>
                <span class="panel-item-title ellipsis">{{ item.title }}</span>
                <span class="pull-left">&nbsp;-&nbsp;</span>
                {% include 'TopxiaAdminBundle:Block/Label:' ~ item.type ~ '.html.twig' %}
                <i class="js-expand-icon glyphicon glyphicon-chevron-down pull-right" title="展开"></i>
                {% if item.count != 1 %}
                  <i class="mrs js-remove-btn glyphicon glyphicon-trash pull-right" title="删除"></i>
                {% endif %}
              </h4>

            </div>
            <div id="{{code}}-collapse-{{ loop.index }}-{{ dataId }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{code}}-heading-{{ dataId }}">
              <div class="panel-body">
               {% include 'TopxiaAdminBundle:Block/Tag:' ~ item.type ~ '.html.twig' %}
              </div>
            </div>
          </div>

        {% endfor %}
      </div>
    {% if item.count != 1 %}
      <div class="btn btn-default text-center js-add-btn" style="width:100%;margin-top:-10px;margin-bottom:20px;">+新增</div>
    {% endif %}

    </section>
  {% else %}
    <ul class="nav nav-pills mvl sortable-list" id="btn-tabs">
      {% include 'TopxiaAdminBundle:Block/Label:' ~ item.type ~ '.html.twig' %}
    </ul>
    <div class="well">

      <div class="tab-content">
        {% include 'TopxiaAdminBundle:Block/Tag:' ~ item.type ~ '.html.twig' %}
      </div>
      <div class="form-group mtl">
        <div class="col-sm-10 col-sm-offset-2">
          <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
          <button id="block-save-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary mrm" data-toggle="block-edit-form" data-target="#block-edit-form">保存设置</button>
        </div>
      </div>
    </div>
  {% endif %}

{% endfor %}